<template>
	<view class="app">
		<up-form labelPosition="left" :model="form">
			<up-form-item v-for="(item,index) in formItemList" :key="index" :label="item.label" borderBottom ref="item1">
				<view v-if="item.name === 'TextInput' || item.name === 'DateTime'">
					{{ item.value }}
				</view>
			</up-form-item>
		</up-form>
	</view>
</template>

<script>
	export default {
		name: "cloud-form",
		props: {
			formData: Object
		},
		watch: {
			formData: {
				handler(a) {
					console.log(a.detail)
					this.formItemList = a.detail;
				},
				deep: true
			}
		},
		data() {
			return {
				formItemList: [],
			};
		},
	}
</script>

<style lang="scss" scoped>
	.app {
		overflow-x: hidden;
		background-color: white;
	}

	::v-deep .u-form-item__body__left {
		width: 80px !important;
	}
</style>